Class: Channel
Constructors
constructor
• new Channel(target
, chanId
)
RPC communication based on window postMessage
Parameters
Name | Type | Description |
---|---|---|
target | Window | essentially a window obj we want to send messages to |
chanId | string | Channel id. Allows one frame to contain multiple plugins. |
Properties
chanId
• Private
Readonly
chanId: string
Channel id. Allows one frame to contain multiple plugins.
eventListeners
• Private
eventListeners: Set
<ChannelEventListener
>
pendingCalls
• Private
pendingCalls: Map
<string
, [(_
: undefined
| string
| void
| UnlockParticipantResponse
| DisconnectParticipantResponse
| DialResponse
| TransferParticipantResponse
| MuteParticipantResponse
| UnmuteParticipantResponse
| MuteguestsResponse
| UnmuteguestsResponse
| VideoMuteParticipantResponse
| VideoUnmuteParticipantResponse
| LockResponse
| UnlockResponse
| DisconnectResponse
| TransformLayoutResponse
| MessageConferenceResponse
| MessageParticipantResponse
| BuzzParticipantResponse
| ClearbuzzParticipantResponse
| SpotlightonParticipantResponse
| SpotlightoffParticipantResponse
| OverlaytextParticipantResponse
| DtmfParticipantResponse
| DtmfResponse
| { data
: unknown
; status
: number
} | ParticipantsResponse
| { breakout_uuid
: string
} | BreakoutsDisconnectResponse
| BreakoutDisconnectResponse
| BreakoutsEmptyResponse
| ButtonRPCReply
<undefined
> | GenericRPCReply
<undefined
> | { ack
: true
}) => void
, (_
: Error
) => void
]>
target
• Private
target: Window
essentially a window obj we want to send messages to
Accessors
targetWindow
• get
targetWindow(): Window
Returns
Window
Methods
addEventListener
▸ addEventListener(listener
): void
Parameters
Name | Type |
---|---|
listener | ChannelEventListener |
Returns
void
callRPC
▸ callRPC<T
>(method
, payload
, transfer?
): Promise
<RPCCallReply
<T
>>
Type parameters
Name | Type |
---|---|
T | extends keyof RPCCalls |
Parameters
Name | Type |
---|---|
method | T |
payload | RPCCalls [T ][``"payload"``] |
transfer? | Transferable [] |
Returns
Promise
<RPCCallReply
<T
>>
emitEvent
▸ Private
emitEvent(event
): void
Parameters
Name | Type |
---|---|
event | Omit <{ chanId : string ; event : "participant:disconnected" ; payload : { participantUuid : string } }, "chanId" > | Omit <{ chanId : string ; event : "ui:button:click" ; payload : { buttonId : string ; input : { buttonId : string } } | { buttonId : string ; input : { participantUuid : string } } | { buttonId : string ; input : undefined } }, "chanId" > | Omit <{ chanId : string ; event : "ui:form:input" ; payload : { input : FormInput ; modalId : string } }, "chanId" > | Omit <{ chanId : string ; event : "ui:prompt:input" ; payload : { input : string ; modalId : string } }, "chanId" > | Omit <{ chanId : string ; event : "event:conference:authenticated" ; payload : { conferenceAlias : string ; conferenceName? : string } }, "chanId" > | Omit <{ chanId : string ; event : "event:conferenceStatus" ; payload : { id : string ; status : ConferenceStatus } }, "chanId" > | Omit <{ chanId : string ; event : "event:connected" ; payload : undefined }, "chanId" > | Omit <{ chanId : string ; event : "event:disconnected" ; payload : { error : string ; errorCode : ExtendedInfinityErrorCode } }, "chanId" > | Omit <{ chanId : string ; event : "event:userInitiatedDisconnect" ; payload : undefined }, "chanId" > | Omit <{ chanId : string ; event : "event:me" ; payload : { id : string ; participant : InfinityParticipant } }, "chanId" > | Omit <{ chanId : string ; event : "event:message" ; payload : Message }, "chanId" > | Omit <{ chanId : string ; event : "event:directMessage" ; payload : Message }, "chanId" > | Omit <{ chanId : string ; event : "event:applicationMessage" ; payload : ApplicationMessage }, "chanId" > | Omit <{ chanId : string ; event : "event:transfer" ; payload : TransferDetails }, "chanId" > | Omit <{ chanId : string ; event : "event:cancelTransfer" ; payload : Record <string , string > }, "chanId" > | Omit <{ chanId : string ; event : "event:stage" ; payload : Stage [] }, "chanId" > | Omit <{ chanId : string ; event : "event:participants" ; payload : { id : string ; participants : InfinityParticipant [] } }, "chanId" > | Omit <{ chanId : string ; event : "event:participantJoined" ; payload : { id : string ; participant : InfinityParticipant } }, "chanId" > | Omit <{ chanId : string ; event : "event:participantLeft" ; payload : { id : string ; participant : InfinityParticipant } }, "chanId" > | Omit <{ chanId : string ; event : "event:raiseHand" ; payload : { id : string ; participant : InfinityParticipant } }, "chanId" > | Omit <{ chanId : string ; event : "event:presentationConnectionStateChange" ; payload : { recv : RTCPeerConnectionState ; send : RTCPeerConnectionState } }, "chanId" > | Omit <{ chanId : string ; event : "event:layoutUpdate" ; payload : LayoutEvent }, "chanId" > | Omit <{ chanId : string ; event : "event:breakoutBegin" ; payload : BreakoutRoom }, "chanId" > | Omit <{ chanId : string ; event : "event:breakoutEnd" ; payload : BreakoutRoom }, "chanId" > | Omit <{ chanId : string ; event : "event:breakoutRefer" ; payload : BreakoutReferDetails }, "chanId" > | Omit <{ chanId : string ; event : "event:languageSelect" ; payload : string }, "chanId" > | Omit <{ chanId : string ; payload : undefined | DisconnectParticipantResponse ; replyTo : string ; rpc : "participant:disconnect" }, "chanId" > | Omit <{ chanId : string ; payload : { ack : true } ; replyTo : string ; rpc : "syn" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | DialResponse ; replyTo : string ; rpc : "conference:dialOut" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | MessageConferenceResponse | MessageParticipantResponse ; replyTo : string ; rpc : "conference:sendMessage" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | MessageConferenceResponse | MessageParticipantResponse ; replyTo : string ; rpc : "conference:sendApplicationMessage" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | LockResponse | UnlockResponse ; replyTo : string ; rpc : "conference:lock" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | MuteguestsResponse | UnmuteguestsResponse ; replyTo : string ; rpc : "conference:muteAllGuests" }, "chanId" > | Omit <{ chanId : string ; payload : void ; replyTo : string ; rpc : "conference:setBandwidth" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | TransformLayoutResponse ; replyTo : string ; rpc : "conference:setLayout" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | { data : unknown ; status : number } ; replyTo : string ; rpc : "conference:sendRequest" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | DisconnectResponse ; replyTo : string ; rpc : "conference:disconnectAll" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | ParticipantsResponse ; replyTo : string ; rpc : "conference:requestParticipants" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | { breakout_uuid : string } ; replyTo : string ; rpc : "conference:breakout" }, "chanId" > | Omit <{ chanId : string ; payload : void ; replyTo : string ; rpc : "conference:joinBreakoutRoom" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | BreakoutsDisconnectResponse ; replyTo : string ; rpc : "conference:closeBreakouts" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | BreakoutDisconnectResponse ; replyTo : string ; rpc : "conference:closeBreakoutRoom" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | BreakoutsEmptyResponse ; replyTo : string ; rpc : "conference:emptyBreakouts" }, "chanId" > | Omit <{ chanId : string ; payload : void ; replyTo : string ; rpc : "conference:breakoutMoveParticipants" }, "chanId" > | Omit <{ chanId : string ; payload : string ; replyTo : string ; rpc : "conference:currentRoomId" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | TransferParticipantResponse ; replyTo : string ; rpc : "participant:transfer" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | MuteParticipantResponse | UnmuteParticipantResponse ; replyTo : string ; rpc : "participant:mute" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | VideoMuteParticipantResponse | VideoUnmuteParticipantResponse ; replyTo : string ; rpc : "participant:muteVideo" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | SpotlightonParticipantResponse | SpotlightoffParticipantResponse ; replyTo : string ; rpc : "participant:spotlight" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | UnlockParticipantResponse ; replyTo : string ; rpc : "participant:admit" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | BuzzParticipantResponse | ClearbuzzParticipantResponse ; replyTo : string ; rpc : "participant:raiseHand" }, "chanId" > | Omit <{ chanId : string ; payload : void ; replyTo : string ; rpc : "participant:setRole" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | OverlaytextParticipantResponse ; replyTo : string ; rpc : "participant:setTextOverlay" }, "chanId" > | Omit <{ chanId : string ; payload : undefined | DtmfParticipantResponse | DtmfResponse ; replyTo : string ; rpc : "participant:sendDTMF" }, "chanId" > | Omit <{ chanId : string ; payload : ButtonRPCReply <undefined > ; replyTo : string ; rpc : "ui:button:add" }, "chanId" > | Omit <{ chanId : string ; payload : ButtonRPCReply <undefined > ; replyTo : string ; rpc : "ui:button:update" }, "chanId" > | Omit <{ chanId : string ; payload : GenericRPCReply <undefined > ; replyTo : string ; rpc : "ui:form:open" }, "chanId" > | Omit <{ chanId : string ; payload : GenericRPCReply <undefined > ; replyTo : string ; rpc : "ui:prompt:open" }, "chanId" > | Omit <{ chanId : string ; payload : GenericRPCReply <undefined > ; replyTo : string ; rpc : "ui:toast:show" }, "chanId" > | Omit <{ chanId : string ; payload : GenericRPCReply <undefined > ; replyTo : string ; rpc : "ui:plugin:toggle" }, "chanId" > | Omit <{ chanId : string ; payload : GenericRPCReply <undefined > ; replyTo : string ; rpc : "ui:removeElement" }, "chanId" > |
Returns
void
onMessage
▸ Private
onMessage(evt
): void
Parameters
Name | Type |
---|---|
evt | MessageEvent <PluginMessage > |
Returns
void
removeEventListener
▸ removeEventListener(listener
): void
Parameters
Name | Type |
---|---|
listener | ChannelEventListener |
Returns
void
replyRPC
▸ replyRPC<T
>(event
): void
Type parameters
Name | Type |
---|---|
T | extends keyof RPCCalls |
Parameters
Name | Type |
---|---|
event | ChannelRPCReply <T > |
Returns
void
sendEvent
▸ sendEvent<T
>(event
): void
Type parameters
Name | Type |
---|---|
T | extends keyof EventMessage |
Parameters
Name | Type |
---|---|
event | ChannelEvent <T > |
Returns
void
unregister
▸ unregister(): void
Returns
void